function showEchartsBar(dom, nameArr, valueArr, text) {
    var myChart = echarts.init(dom);
    var option = {
        tooltip: {
            trigger: 'axis',
            axisPointer: { // 坐标轴指示器，坐标轴触发有效
                type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        xAxis: [{
            type: 'category',
            data: nameArr
        }],
        yAxis: [{
            type: 'value'
        }],
        grid: {
            left: '1%',
            right: '2%',
            bottom: '1%',
            top: '4%',
            containLabel: true
        },
        // grid: {
        //     width: '500px',
        //     height: '300px'
        // },
        series: [{
            data: valueArr,
            name: text,
            type: 'bar'
        }]
    };
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
}
//饼状图
function showEchartsPie(dom, nameArr, valueArr, text) {
    var myChart = echarts.init(dom);
    var option = {
        // title: {
        //     text: '某站点用户访问来源',
        //     subtext: '纯属虚构',
        //     left: 'center'
        // },
        // title: {
        //     left: 'center',
        //     text: title,
        // },
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        // legend: {
        //     orient: 'vertical',
        //     left: 'left',
        //     data: nameArr
        // },
        series: [{
            name: text,
            type: 'pie',
            radius: '65%',
            center: ['48%', '45%'],
            data: valueArr,
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }]

    };
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
}
//堆叠柱状图
function showEchartsBar2(dom, nameArr, valueArr, text) {
    var myChart = echarts.init(dom);
    var option = {
        color: ['#3cb371', '#b8860b', '#30e0e0',
            '#ff7f50', '#87cefa', '#ffa500', '#40e0d0'
        ],
        tooltip: {
            trigger: 'axis',
            axisPointer: { // 坐标轴指示器，坐标轴触发有效
                type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [{
            type: 'category',
            data: nameArr,
            axisLabel: {
                // formatter:'{value}(平方米)',  //给y轴添加单位
                textStyle: {
                    color: 'white',
                    fontSize: 10
                }
            },
            axisLine: {
                lineStyle: {
                    color: 'white'
                }
            },
            splitLine: {
                lineStyle: {
                    color: 'rgba(170,170,170,1)'
                }
            }
        }],
        yAxis: [{
            type: 'value',
            name: '单位(公顷)',
            axisLabel: {
                formatter: '{value}', //给y轴添加单位                                   
                textStyle: {
                    color: 'white',
                    fontSize: 10
                }
            },
            axisLine: {
                lineStyle: {
                    color: 'white'
                }
            }
        }],
        series: valueArr
    };
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
}